//弹窗
jQuery.yhdtool = yhdLib = {
    popwin:function(param) {
        var arg = param,tcBox = ".popGeneral",sFun = arg.fun ? arg.fun :[],cTxt = arg.popcontentstr ? arg.popcontentstr : "",popEvent  = arg.popevent ? arg.popevent:"click",autoClose = arg.autoclosetime;
        if(arg.clickid){$(arg.clickid).bind(popEvent,function(){if($(".popGeneral").length == 0) popMask();});} else{ if($(".popGeneral").length == 0) popMask(); }
        function popMask(){
            var dwidth = $(window).width(),dheight = $(document).height();
            if(arg.poptitle) var popBOX = '<div class="popGeneral"><div class="top_tcgeneral"><h4>'+ arg.poptitle +'</h4><span class="close_tcg">关闭</span></div></div>';else var popBOX = '<div class="popGeneral"></div>';
            if(arg.mask || arg.mask==null)$('<div class="mask_tcdiv" style="z-index:9998"></div>').appendTo($("body")).css({position:"absolute",top:0,right:0,bottom:0,left:0,Zindex:9998,width:dwidth+"px",height:dheight+"px",background:"#000",opacity:0.3});
			$(popBOX).appendTo($("body"));		
            if(arg.popwidth){$(".popGeneral").width(arg.popwidth);}
            if(arg.popheight){$(".popGeneral").height(arg.popheight);}
            var apTxt = cTxt? $(cTxt) : $(arg.popcontent).clone(); apTxt.appendTo($(tcBox)).show();
            popPosition(); for(var funI = sFun.length-1;funI >= 0;funI--) eval(sFun[funI]+"()");
            return false;
        }
        function popPosition(){			
			var popwinTop = 0;
            $(window).resize(function(){
                var width = $(tcBox).width(),height = $(tcBox).height()/2,windWidth = $(window).width(),pLeft = (windWidth-width)/2;
                $(tcBox).css({left:pLeft,top:'50%',bottom:"auto",marginTop:"-"+ height+"px"});
                popwinTop = $(window).height()/2 - height;
            }).trigger("resize");
            if($.browser.msie && $.browser.version == 6.0){ $(window).scroll(function(){ $(tcBox).css({top:popwinTop + $(window).scrollTop()+"px",marginTop:0}); }).trigger("scroll"); }							
            $(".close_tcg").click(function(){ closeTc(); });
            if(autoClose){setTimeout(function(){ closeTc(); },autoClose);}
            if(arg.outareaclose) $(".mask_tcdiv").click(function(){ closeTc(); });
            $(window).keydown(function(event){ if(event.keyCode == 27) closeTc(); });
            return false;
        }
        function closeTc(){ $(".popGeneral").remove();$(".mask_tcdiv").remove(); }return false;
    },
    popclose:function(){
        $(".popGeneral,.mask_tcdiv").remove();
    },//关闭弹窗
    popwinreload:function(){ if($("body > .popGeneral").length) $(window).trigger("resize"); }//弹框重新定位
}
//用户反馈
yhdLib.popwin({
	clickid:".moudleListBtn",
	poptitle:"",
	popcontent:".complaintsBox",
	fun:["tab1"]
})
//取消
function tab1(){$(".popGeneral .Btn").click(function(){
	$(this).parents(".popGeneral").remove();$(".mask_tcdiv").remove();
	});
}


